#pragma once
#include <iostream>
#include <string>
#include "util.hpp"

namespace logNs {
    using namespace utilNs;
    enum { // 日志等级
        Info,
        Debug,
        Waring,
        Error,
        Fatal
    };
    std::ostream& Log(const std::string level, const std::string& file_name, int line) {
        std::string header = "[" + level + "][" + TimeUtil::TimeStampToLocalTime(time(nullptr))\
         + "][" + file_name + ": " + std::to_string(line) + "]"; 
        std::cout << header;
        return std::cout;
    }

    #define LOG(level) Log(#level, __FILE__, __LINE__)

};